package com.wmh.baseservice.admin.service.impl;

import com.wmh.baseservice.admin.mapper.AdMenuMapper;
import com.wmh.baseservice.admin.pojo.AdMenu;
import com.wmh.baseservice.admin.pojo.AdRoleMenu;
import com.wmh.baseservice.admin.service.AdMenuService;
import com.wmh.baseservice.admin.service.AdRoleMenuService;
import com.wmh.baseservice.common.ex.ServiceException;
import com.wmh.baseservice.common.mybatisplus.methods.CommonServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author mmx generator
 * @since 2021-02-03
 */
@Service
public class AdMenuServiceImpl extends CommonServiceImpl<AdMenuMapper, AdMenu> implements AdMenuService {

    @Resource
    private AdRoleMenuService adRoleMenuService;


    @Override
    @Transactional(rollbackFor = Exception.class)
    public void test() {
        AdRoleMenu adRoleMenu = new AdRoleMenu();
        AdRoleMenu adRoleMenu1 = adRoleMenu.setId(8848L).setMenuId(666L);
        adRoleMenuService.save(adRoleMenu1);
        throw new ServiceException();
    }
}
